﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace UltimatePresentation.Native.Win32
{
	[StructLayout(LayoutKind.Sequential)]
	public struct POINT
	{
		private int _x;
		private int _y;

		public POINT(int x, int y)
		{
			_x = x;
			_y = y;
		}

		public int X
		{
			get { return _x; }
			set { _x = value; }
		}

		public int Y
		{
			get { return _y; }
			set { _y = value; }
		}

		public override bool Equals(object obj)
		{
			if (obj is POINT)
			{
				var point = (POINT)obj;

				return point._x == _x && point._y == _y;
			}
			return base.Equals(obj);
		}
		public override int GetHashCode()
		{
			return _x.GetHashCode() ^ _y.GetHashCode();
		}

		public static bool operator ==(POINT a, POINT b)
		{
			return a._x == b._x && a._y == b._y;
		}

		public static bool operator !=(POINT a, POINT b)
		{
			return !(a == b);
		}
	}
}
